/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tk.eigh.ksvg.renderer.text;

import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFRenderer;
import org.apache.myfaces.commons.util.ArrayUtils;
import org.apache.myfaces.shared.renderkit.html.HtmlRendererUtils;
import tk.eigh.ksvg.SVG;
import tk.eigh.ksvg.renderer.SVGRenderer;

/**
 *
 * @author nt
 */
@JSFRenderer(renderKitId = "SVG", type = "SVGTextContentRenderer", family = "text.TextContent")
public class SVGTextContentRenderer extends SVGRenderer {


    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        super.encodeBegin(context, component);
    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        super.encodeEnd(context, component);
    }

    @Override
    public void renderCommonAttributes(ResponseWriter writer, UIComponent component, FacesContext context) throws IOException {
        super.renderCommonAttributes(writer, component, context);
        HtmlRendererUtils.renderHTMLAttributes(writer, component, (String[]) ArrayUtils.concat(
                SVG.COMMON_ATTRS, new String[]{SVG.VISIBILITY_ATTR, SVG.DISPLAY_ATTR}));
        //TODO clientBehaviors
        HtmlRendererUtils.renderHTMLAttributes(writer, component, SVG.GRAPHICAL_EVENT_ATTRS);
    }
}
